# Contributor: Duncan Bellamy <dunk@denkimushi.com>
# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Duncan Bellamy <dunk@denkimushi.com>
pkgname=py3-cleo
_realname=cleo
pkgver=0.8.1
pkgrel=4
pkgdesc="Python3 library to create beautiful and testable command-line interfaces"
url="https://github.com/sdispater/cleo"
arch="noarch"
license="MIT"
depends="python3 py3-pastel py3-pylev py3-clikit"
checkdepends="py3-pytest py3-pytest-mock"
makedepends="py3-build py3-installer py3-poetry-core"
source="$pkgname-$pkgver.tar.gz::https://github.com/sdispater/cleo/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/$_realname-$pkgver"

build() {
	# XXX: hack for poetry to not ignore files
	GIT_DIR=. python3 -m build --no-isolation --wheel
}

check() {
	python3 -m installer -d testenv \
		dist/cleo-$pkgver-py2.py3-none-any.whl
	local sitedir="$(python3 -c 'import site;print(site.getsitepackages()[0])')"
	PYTHONPATH="$PWD/testenv/$sitedir" python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		dist/cleo-$pkgver-py2.py3-none-any.whl
}

sha512sums="
9cd470063db9866a526f0bb8619d772c585377d5b1a662e0f94bad9fb9c853598b176444ca1ac0fadec82992196c471646504d6a28d4dcd1171433b8d160be9c  py3-cleo-0.8.1.tar.gz
"
